import request from "@/utils/request";
export const getAllCommodity = params => {
    return request({
        url: "/admin/api/rest/commodities",
        params,
    });
};
export const addCommodity = data => {
    return request({
        url: "/admin/api/rest/commodities",
        method: "POST",
        data,
    });
};
export const updateCommodity = data => {
    return request({
        url: "/admin/api/rest/commodities",
        method: "PATCH",
        data,
    });
};
export const deleteCommodity = data => {
    return request({
        url: "/admin/api/rest/commodities",
        method: "DELETE",
        data,
    });
};

export const getAllCat = params => {
    return request({
        url: "/admin/api/rest/categories",
        params,
    });
};
export const addCat = data => {
    return request({
        url: "/admin/api/rest/categories",
        method: "POST",
        data,
    });
};
export const updateCat = data => {
    return request({
        url: "/admin/api/rest/categories",
        method: "PATCH",
        data,
    });
};
export const deleteCat = data => {
    return request({
        url: "/admin/api/rest/categories",
        method: "DELETE",
        data,
    });
};
